#include "Mutex.h"

Mutex::Mutex() {
	pthread_mutex_init(&m, 0);
	pthread_cond_init(&cv,0);
}

Mutex::~Mutex() {
	pthread_mutex_destroy(&m);
}

void Mutex::lock() {
	pthread_mutex_lock(&m);
}

Mutex::Mutex(const Mutex& c) {
}

void Mutex::unlock() {
	pthread_mutex_unlock(&m);
}

void Mutex::wait() {
	pthread_cond_wait(&cv, &m);
}

void Mutex::signal() {
	pthread_cond_signal (&cv);
}

void Mutex::broadcast() {
	pthread_cond_broadcast (&cv);
}
